package com.utils.basejava.concurrent.Thread;

public class ThreadLocalUtil {
	private static ThreadLocal<Long> timeLong = new ThreadLocal<Long>();
	
	public void begin() {
		timeLong.set(System.currentTimeMillis());
	}
	
	public long end() {
		return System.currentTimeMillis()-timeLong.get();
	}
	
	public static void main(String[] args) {
		ThreadLocalUtil tlu = new ThreadLocalUtil();
		tlu.begin();
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println(tlu.end());
	}
} 
